/**
 * @filename:SwitchOrderPoolDao 2020年07月01日
 * @project hotel-admin  V1.0
 * Copyright(c) 2020 Zhang·JZ Co. Ltd.
 * All right reserved.
 */
package hotel.switchs.oversea.online.mapper;

import hotel.base.oversea.repository.MyMapper;
import hotel.switchs.oversea.api.VO.order.OrderListSearchVO;
import hotel.switchs.oversea.api.VO.order.OrderListVO;
import hotel.switchs.oversea.api.dto.SwitchOrderPoolDto;
import hotel.switchs.oversea.api.entity.order.SwitchOrderPool;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * @Description:TODO(平台携程订单实时状态池 将携程取到所有订单存储该表
 * 取消，下单都从该表操作数据访问层)
 * @version: V1.0
 * @author: Zhang·JZ
 */
public interface SwitchOrderPoolMapper extends MyMapper<SwitchOrderPool> {

    /**
     * 根据携程订单获取对应记录
     *
     * @param orderId
     * @return
     */
    SwitchOrderPool findOrderBySwitchOrderId(String orderId);


    /**
     * 根据携程订单获取对应记录
     *
     * @param dltOrderId
     * @return
     */
    SwitchOrderPool findOrderBySwitchDltOrderId(String dltOrderId);

    /**
     * <H1>获取可向美团下载订单的订单详情</H1>
     *
     * @param
     * @param dltOrderIdList
     * @return hotel.switchs.oversea.api.entity.order.SwitchOrderPool
     * @author HuangT
     * @date 2020/7/7 20:46
     */
    SwitchOrderPool getSwitchOrderInfoForMt(@Param("dltOrderIdList") List<String> dltOrderIdList);

    /**
     * @param
     * @return hotel.switchs.oversea.api.entity.order.SwitchOrderPool
     * @author Qiuyy
     */
    List<SwitchOrderPool> getSwitchOrderInfoForMtAsc();

    /**
     * <H1>更新订单状态</H1>
     *
     * @param switchOrderPool
     * @return hotel.base.oversea.utils.Result
     * @author HuangT
     * @date 2020/7/9 16:18
     */
    void updateOrderResult(SwitchOrderPool switchOrderPool);

    List<SwitchOrderPool> getDelayChangeBookingOrders();

    void updatePoolIsOrderByMdkey(Map map);

    List<String> getDelayRejectBookingOrders(Map map);

    List<SwitchOrderPoolDto> getDelayRejectBookingOrders();

    /**
     * <H1>获取订单列表</H1>
     *
     * @param orderListSearchVO
     * @return List<OrderListVO>
     * @author HuangT
     * @date 2020/7/20 18:03
     */
    List<OrderListVO> getOrderList(OrderListSearchVO orderListSearchVO);

    /**
     * <H1>更新系统状态</H1>
     *
     * @param switchOrderPool 实体对象
     * @return hotel.base.oversea.utils.Result<java.lang.Object>
     * @author HuangT
     * @Date 2020/9/7 15:02
     */
    void updateOrderState(SwitchOrderPool switchOrderPool);

    Integer hasMtBookingBySwOrderId(String swOrderId);
    Integer checkExistValiBookingBySwOrderId(String swOrderId);


    /**
     * <H1>更新订单状态</H1>
     *
     * @param switchOrderPool
     * @return hotel.base.oversea.utils.Result
     * @author HuangT
     * @date 2020/7/9 16:18
     */
    int updateOrderStateByPK(SwitchOrderPool switchOrderPool);


    /**
     * <H1>更新美团订单</H1>
     */
    int updateMtOrderIdByOrderId(@Param("map") Map map);
}
